import request from '@/utils/request';

let baseUrl = '/property-portal/v1/api';

// 水表库项目列表
export const waterProjectListApi = params => {
	return request({
		url: `${baseUrl}/waterMeter/queryProjectList`,
		method: 'post',
		data: params,
	});
};

// 水表抄表项目列表
export const waterCopyProjectListApi = params => {
	return request({
		url: `${baseUrl}/waterMeterRecords/queryProjectList`,
		method: 'post',
		data: params,
	});
};

// 电表库项目列表
export const electricityProjectListApi = params => {
	return request({
		url: `${baseUrl}/electricMeter/queryProjectList`,
		method: 'post',
		data: params,
	});
};

// 电表抄表项目列表
export const electricityCopyProjectListApi = params => {
	return request({
		url: `${baseUrl}/electricMeterRecords/queryProjectList`,
		method: 'post',
		data: params,
	});
};

// 公区能源费项目列表
export const publicAreaProjectListApi = params => {
	return request({
		url: `${baseUrl}/tCommonAreaMeter/queryProjectCommonAreaMeterList`,
		method: 'post',
		data: params,
	});
};

// 商户能源费项目列表
export const energyProjectListApi = params => {
	return request({
		url: `${baseUrl}/tWaterMeterRelation/queryProjectWaterMeterRelationList`,
		method: 'post',
		data: params,
	});
};

// 商户能源费列表
export const energyListApi = params => {
	return request({
		url: `${baseUrl}/tWaterMeterRelation/queryWaterMeterRelationContractList`,
		method: 'post',
		data: params,
	});
};

// ------------------------------------------------------------------------水表----------------------------------------------------------------------------

//水表库
export const waterMeterListApi = params => {
	return request({
		url: `${baseUrl}/waterMeter/queryWaterMeterList`,
		method: 'post',
		data: params,
	});
};

//水表库 - 选择父级列表
export const waterParentListApi = params => {
	return request({
		url: `${baseUrl}/waterMeter/findWaterMeterList`,
		method: 'post',
		data: params,
	});
};

//水表库 - 配置更新
export const waterMeterSettingApi = params => {
	return request({
		url: `${baseUrl}/waterMeter/editWaterMaterDetails`,
		method: 'post',
		data: params,
	});
};

//水表库 - 配置查看
export const waterMeterSettingInfoApi = params => {
	return request({
		url: `${baseUrl}/waterMeter/getWaterMeterDetails/${params}`,
		method: 'get',
	});
};

// 水表详情
export const waterMeterInfoApi = params => {
	return request({
		url: `${baseUrl}/tWaterMeterRelation/findWaterMeterRelationInfo`,
		method: 'post',
		data: params,
	});
};

//水表库 - 二维码
export const waterQrCodeDownloadApi = params => {
	return request({
		url: `${baseUrl}/waterMeter/download`,
		method: 'post',
		data: params,
	});
};

//水表抄表列表
export const waterCopyListApi = params => {
	return request({
		url: `${baseUrl}/waterMeterRecords/queryReadRecordList`,
		method: 'post',
		data: params,
	});
};

//水表抄表修改
export const waterCopyUpdateApi = params => {
	return request({
		url: `${baseUrl}/waterMeterRecords/editMeterReading`,
		method: 'post',
		data: params,
	});
};

//水表抄表详情
export const waterCopyInfoApi = params => {
	return request({
		url: `${baseUrl}/waterMeterRecords/getRecordDetails/${params}`,
		method: 'get',
	});
};

//水表抄表推送
export const waterCopyPushApi = params => {
	return request({
		url: `${baseUrl}/waterMeterRecords/push/${params}`,
		method: 'post',
	});
};

//水表抄表推送-全部
export const waterCopyPushAllApi = params => {
	return request({
		url: `${baseUrl}/waterMeterRecords/pushAll/${params}`,
		method: 'post',
	});
};

//水表挂表
export const waterSignSaveApi = params => {
	return request({
		url: `${baseUrl}/tWaterMeterRelation/createWaterMeterRelation`,
		method: 'post',
		data: params,
	});
};

//水表生效的数据源
export const waterMeterSourceApi = params => {
	return request({
		url: `${baseUrl}/tWaterMeterRelation/queryWaterMeterRelationInfoList`,
		method: 'post',
		data: params,
	});
};

//水表解表列表
export const waterMeterBreakListApi = params => {
	return request({
		url: `${baseUrl}/tWaterMeterRelation/queryWaterMeterRelationAddList`,
		method: 'post',
		data: params,
	});
};

//水表解表
export const waterBreakSaveApi = params => {
	return request({
		url: `${baseUrl}/tWaterMeterRelation/reduceWaterMeterRelation`,
		method: 'post',
		data: params,
	});
};

//水表查看
export const waterMeterSeeApi = params => {
	return request({
		url: `${baseUrl}/tWaterMeterRelation/queryWaterMeterRelationViewList`,
		method: 'post',
		data: params,
	});
};

//水表明细
export const waterMeterDetailListApi = params => {
	return request({
		url: `${baseUrl}/tWaterMeterRelation/queryWaterMeterRelationDetailList`,
		method: 'post',
		data: params,
	});
};

//水表费用
export const waterMeterCostListApi = params => {
	return request({
		url: `${baseUrl}/tWaterMeterRelation/queryWaterMeterRelationExpenseList`,
		method: 'post',
		data: params,
	});
};

//水表挂表记录
export const waterMeterRecordListApi = params => {
	return request({
		url: `${baseUrl}/waterMeter/waterMeterRelationList`,
		method: 'post',
		data: params,
	});
};

// ------------------------------------------------------------------------电表----------------------------------------------------------------------------

//电表库
export const electricityMeterListApi = params => {
	return request({
		url: `${baseUrl}/electricMeter/queryElectricMeterList`,
		method: 'post',
		data: params,
	});
};

//电表库 - 选择父级列表
export const electricityParentListApi = params => {
	return request({
		url: `${baseUrl}/electricMeter/findElectricMeterList`,
		method: 'post',
		data: params,
	});
};

//电表库 - 配置更新
export const electricityMeterSettingApi = params => {
	return request({
		url: `${baseUrl}/electricMeter/editElectricMaterDetails`,
		method: 'post',
		data: params,
	});
};

//电表库 - 配置查看
export const electricityMeterSettingInfoApi = params => {
	return request({
		url: `${baseUrl}/electricMeter/getElectricMeterDetails/${params}`,
		method: 'get',
	});
};

// 电表详情
export const electricityMeterInfoApi = params => {
	return request({
		url: `${baseUrl}/tWaterMeterRelation/findElectricMeterRelationInfo`,
		method: 'post',
		data: params,
	});
};

//电表库 - 二维码
export const electricityQrCodeDownloadApi = params => {
	return request({
		url: `${baseUrl}/electricMeter/download`,
		method: 'post',
		data: params,
	});
};

//电表抄表列表
export const electricityCopyListApi = params => {
	return request({
		url: `${baseUrl}/electricMeterRecords/queryElectricMeterReadRecordList`,
		method: 'post',
		data: params,
	});
};

//电表抄表-修改 | 抄表 | 推单
export const electricityCopyUpdateApi = params => {
	return request({
		url: `${baseUrl}/electricMeterRecords/saveMeterReading`,
		method: 'post',
		data: params,
	});
};

//电表抄表-详情
export const electricityCopyInfoApi = data => {
	return request({
		url: `${baseUrl}/electricMeterRecords/findElectricMeterRecordView`,
		method: 'post',
		data
	});
};

//电表挂表
export const electricitySignSaveApi = params => {
	return request({
		url: `${baseUrl}/tWaterMeterRelation/createElectricMeterRelation`,
		method: 'post',
		data: params,
	});
};

//电表生效的数据源
export const electricityMeterSourceApi = params => {
	return request({
		url: `${baseUrl}/tWaterMeterRelation/queryElectricMeterRelationInfoList`,
		method: 'post',
		data: params,
	});
};

//电表解表列表
export const electricityMeterBreakListApi = params => {
	return request({
		url: `${baseUrl}/tWaterMeterRelation/queryElectricMeterRelationAddList`,
		method: 'post',
		data: params,
	});
};

//电表解表
export const electricityBreakSaveApi = params => {
	return request({
		url: `${baseUrl}/tWaterMeterRelation/reduceElectricMeterRelation`,
		method: 'post',
		data: params,
	});
};

//电表查看
export const electricityMeterSeeApi = params => {
	return request({
		url: `${baseUrl}/tWaterMeterRelation/queryElectricMeterRelationViewList`,
		method: 'post',
		data: params,
	});
};

//电表明细-普通
export const electricityMeterDetailListApi = params => {
	return request({
		url: `${baseUrl}/tWaterMeterRelation/queryElectricMeterRelationDetailList`,
		method: 'post',
		data: params,
	});
};

//电表明细-智能
export const electricitySmartMeterDetailListApi = params => {
	return request({
		url: `${baseUrl}/tWaterMeterRelation/queryElectricMeterRelationEnergyDetailList`,
		method: 'post',
		data: params,
	});
};

//电表费用-普通
export const electricityMeterCostListApi = params => {
	return request({
		url: `${baseUrl}/tWaterMeterRelation/queryElectricMeterRelationExpenseList`,
		method: 'post',
		data: params,
	});
};

//电表费用-智能
export const electricitySmartMeterCostListApi = params => {
	return request({
		url: `${baseUrl}/tWaterMeterRelation/queryElectricMeterRelationEnergyExpenseList`,
		method: 'post',
		data: params,
	});
};

//电表挂表记录
export const electricityMeterRecordListApi = params => {
	return request({
		url: `${baseUrl}/electricMeter/electricMeterRelationList`,
		method: 'post',
		data: params,
	});
};

// ------------------------------------------------------------------------计费配置----------------------------------------------------------------------------
// 计费配置列表
export const chargeProjectListApi = params => {
	return request({
		url: `${baseUrl}/waterMeterAllocation/queryProjectList`,
		method: 'post',
		data: params,
	});
};

// 水表计费配置保存
export const chargeWaterSaveApi = params => {
	return request({
		url: `${baseUrl}/waterMeterAllocation/editWaterMeterAllocationDetails`,
		method: 'post',
		data: params,
	});
};

// 水表计费配置详情
export const chargeWaterInfoApi = projectCode => {
	return request({
		url: `${baseUrl}/waterMeterAllocation/getWaterMeterAllocationDetails/${projectCode}`,
		method: 'get',
	});
};

// 电表计费配置保存
export const chargeEleSaveApi = params => {
	return request({
		url: `${baseUrl}/electricMeterAllocation/editElectricMeterAllocationDetails`,
		method: 'post',
		data: params,
	});
};

// 电表计费配置详情
export const chargeEleInfoApi = projectCode => {
	return request({
		url: `${baseUrl}/electricMeterAllocation/getElectricMeterAllocationDetails/${projectCode}`,
		method: 'get',
	});
};

// ------------------------------------------------------------------------公区能源费----------------------------------------------------------------------------
// 列表
export const publicAreaListApi = params => {
	return request({
		url: `${baseUrl}/tCommonAreaMeter/queryCommonAreaMeterList`,
		method: 'post',
		data: params,
	});
};

//新增
export const publicAreaAddApi = params => {
	return request({
		url: `${baseUrl}/tCommonAreaMeter/addCommonAreaMeter`,
		method: 'post',
		data: params,
	});
};

//设备列表
export const deviceListApi = params => {
	return request({
		url: `${baseUrl}/tCommonAreaMeter/queryCommonAreaMeterDeviceList`,
		method: 'post',
		data: params,
	});
};

//挂表-电
export const eAreaSignApi = params => {
	return request({
		url: `${baseUrl}/tCommonAreaMeter/createCommonAreaMeterElectric`,
		method: 'post',
		data: params,
	});
};

//解表-电
export const eAreaBreakApi = params => {
	return request({
		url: `${baseUrl}/tCommonAreaMeter/reduceCommonAreaMeterElectric`,
		method: 'post',
		data: params,
	});
};

// 详情-电
export const eAreaInfoApi = params => {
	return request({
		url: `${baseUrl}/tCommonAreaMeter/findCommonAreaMeterElectricInfo`,
		method: 'post',
		data: params,
	});
};

//查看-电
export const eAreaSeeApi = params => {
	return request({
		url: `${baseUrl}/tCommonAreaMeter/queryCommonAreaMeterElectricViewList`,
		method: 'post',
		data: params,
	});
};

//解表列表-电
export const eAreaBreakListApi = params => {
	return request({
		url: `${baseUrl}/tCommonAreaMeter/queryCommonAreaMeterElectricList`,
		method: 'post',
		data: params,
	});
};

//明细-电-普通表
export const eAreaDetailApi = params => {
	return request({
		url: `${baseUrl}/tCommonAreaMeter/queryCommonAreaMeterElectricDetailList`,
		method: 'post',
		data: params,
	});
};

//明细-电-智能表
export const eAreaSmartDetailApi = params => {
	return request({
		url: `${baseUrl}/tCommonAreaMeter/queryCommonAreaMeterElectricEnergyDetailList`,
		method: 'post',
		data: params,
	});
};

//挂表-水
export const wAreaSignApi = params => {
	return request({
		url: `${baseUrl}/tCommonAreaMeter/createCommonAreaMeterWater`,
		method: 'post',
		data: params,
	});
};

//解表-水
export const wAreaBreakApi = params => {
	return request({
		url: `${baseUrl}/tCommonAreaMeter/reduceCommonAreaMeterWater`,
		method: 'post',
		data: params,
	});
};

// 详情-水
export const wAreaInfoApi = params => {
	return request({
		url: `${baseUrl}/tCommonAreaMeter/findCommonAreaMeterWaterInfo`,
		method: 'post',
		data: params,
	});
};

//查看-水
export const wAreaSeeApi = params => {
	return request({
		url: `${baseUrl}/tCommonAreaMeter/queryCommonAreaMeterWaterViewList`,
		method: 'post',
		data: params,
	});
};

//解表列表-水
export const wAreaBreakListApi = params => {
	return request({
		url: `${baseUrl}/tCommonAreaMeter/queryCommonAreaMeterWaterList`,
		method: 'post',
		data: params,
	});
};

//明细-水-普通表
export const wAreaDetailApi = params => {
	return request({
		url: `${baseUrl}/tCommonAreaMeter/queryCommonAreaMeterWaterDetailList`,
		method: 'post',
		data: params,
	});
};

//明细-水-智能表
export const wAreaSmartDetailApi = params => {
	return request({
		url: `${baseUrl}/tCommonAreaMeter/queryCommonAreaMeterWaterEnergyDetailList`,
		method: 'post',
		data: params,
	});
};

//查询公区清单列表
export const inventoryListByProjectApi = params => {
	return request({
		url: `${baseUrl}/tCommonAreaMeter/findCommonAreaMeterInfoList`,
		method: 'post',
		data: params,
	});
};

// ----------------------------------------------------------------------------------------------------------------------------------------------------

// 合同详情
export const contractInfoApi = params => {
	return request({
		url: `${baseUrl}/tWaterMeterRelation/findWaterMeterRelationContractInfo`,
		method: 'post',
		data: params,
	});
};
